#ifndef __ming_fyp_app_DxApp_h__
#define __ming_fyp_app_DxApp_h__

//------------------------------------------------------------------------------
// header includes
#include <d3d9.h>
#include "fyp/core/tuple.h"

//------------------------------------------------------------------------------
namespace ming
{
namespace fyp
{
namespace app
{
	//--------------------------------------------------------------------------
	class IDxApp
	{
	public:
		virtual ~IDxApp() {}
		
		//------------------------------
		// external operations
		typedef tuple<const WCHAR*, bool, int, int> WndInfo;

		virtual WndInfo GetAppWndInfo() = 0;

		virtual bool AcceptDevice(
			D3DCAPS9* caps,
			D3DFORMAT adapterFmt,
			D3DFORMAT backBufFmt) = 0;

		virtual void SetDevice(IDirect3DDevice9* device) = 0;

		virtual void RecreateResources(
			IDirect3DDevice9* device,
			const D3DSURFACE_DESC* backBufDesc) = 0;

		virtual void DestroyResources() = 0;

		virtual void Render(
			IDirect3DDevice9* device,
			float dt) = 0;

		virtual void HandleMouseEvent(
			bool leftBtnDown,
			bool rightBtnDown,
			bool midBtnDown,
			int wheelDelta,
			int xPos,
			int yPos) = 0;

		virtual void HandleKeyboardEvent(
			unsigned int charCode,
			bool keyDown,
			bool altDown) = 0;

		virtual void HandleWindowEvent(
			HWND hWnd,
			UINT uMsg,
			WPARAM wParam,
			LPARAM lParam,
			bool* pbNoFurtherProcessing) = 0;
	};
	
	//--------------------------------------------------------------------------
}
}
}


#endif	//__ming_fyp_app_DxApp_h__